/**
 * 2017年5月18日
 */
package cn.edu.bjtu.net;


import java.net.SocketAddress;

import org.jboss.netty.channel.ChannelHandler;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.handler.codec.string.StringDecoder;  
import org.jboss.netty.handler.codec.string.StringEncoder;  

/**
 * @author Alex
 *
 */
public abstract class BaseServer extends Server implements ChannelPipelineFactory{
	
	public BaseServer(SocketAddress sa) {
		super(sa);
		
	}

	@Override
	public ChannelPipelineFactory getChannelPipelineFactory() {
		return this;
	}

	@Override
	public ChannelPipeline getPipeline() throws Exception {
		 return Channels.pipeline(getIncommingMessageDecoder(),getIncommingMessageEecoder(), getMessageHandler());  
	}
	
	public abstract ChannelHandler  getIncommingMessageDecoder();
	public abstract ChannelHandler  getIncommingMessageEecoder();
	public abstract MessaageHandler getMessageHandler();

}
